package com.qf.day05;

import com.qf.day04.Recursive;

import java.util.Scanner;

public class Cat {
    String breed;
    String color;
    int age;
    String name;
    String sex;
    int happy;
    double weight;
    public void eat(){
        happy=happy+1;
        weight=weight+1;
    }
    public void sleep(){
        happy=happy+2;
    }
    public void triPrint(){
        for (int i = 1; i <=5; i++) {
            for (int j = 1; j <= 5-i; j++) {
                System.out.print(" ");
            }
            for (int j = 1; j <= i; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
    public void jcCalculate(){
        int jc = Recursive.jc(age);
        System.out.println(jc);
    }
    public Cat(){

    }

    public Cat(String name) {
        this.name = name;
    }

    public Cat( String name, int age,String sex) {
        this.age = age;
        this.name = name;
        this.sex = sex;
    }

    public Cat(String breed, String color, int age, String name, String sex, int happy, double weight) {
        this.breed = breed;
        this.color = color;
        this.age = age;
        this.name = name;
        this.sex = sex;
        this.happy = happy;
        this.weight = weight;

    }

    public String getBreed() {
        return breed;
    }

    public void setBreed(String breed) {
        this.breed = breed;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getHappy() {
        return happy;
    }

    public void setHappy(int happy) {
        this.happy = happy;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    @Override
    public boolean equals(Object anObject) {
        if (this == anObject) {
            return true;
        }
        if (anObject instanceof Cat) {
            Cat anotherCat = (Cat) anObject;
            if (this.getName().equals(anotherCat.getName()) && this.getAge() == anotherCat.getAge() && this.getSex().equals(anotherCat.getSex())) {
                return true;
            }
        }
        return false;
    }
}
